home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc1 / chktex.lha / chktex / ChkTeX.rexx < prev    next >
OS/2 REXX Batch file  |  1996-04-30  |  2KB  |  89 lines

  1. /*
  2.  *  ChkTeX v1.3, SCMSG interface.
  3.  *  Copyright (C) 1996 Jens T. Berger Thielemann
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  Contact the author at:
  20.  *        Jens Berger
  21.  *        Spektrumvn. 4
  22.  *        N-0666 Oslo
  23.  *        Norway
  24.  *        E-mail: <jensthi@ifi.uio.no>
  25.  *
  26.  *
  27.  */
  28.  
  29. ScMsgPath = "SC:C/SCMSG"
  30.  
  31.  
  32. Options Failat 21
  33.  
  34. If Arg(1, "O") Then Do
  35.     Call AddLib("rexxreqtools.library", 0, -30, 0)
  36.  
  37.     /* Use reqtools if possible */
  38.  
  39.     If Show("Libraries","rexxreqtools.library") Then Do
  40.         FileName = rtFileRequest( , , "Select LaTeX file", , "rtfi_flags = freqf_patgad" , )
  41.         If RTResult = 0 Then Exit
  42.     End
  43.     Else Do
  44.         Options Prompt "LaTeXFILE/A: "
  45.         Pull FileName
  46.         FileName = Strip(FileName)
  47.     End
  48.     If FileName = "" Then Exit
  49. End
  50. Else FileName = Arg(1)
  51.  
  52. TmpFile = "T:ChkTeX_Temporary_Output"
  53.  
  54. CmdLine = 'ChkTeX -v0b0qs::: '||FileName||' -o '||TmpFile
  55.  
  56. Address Command CmdLine
  57.  
  58. If RC = 0 Then Do
  59.     If ~Show('ports', 'SC_SCMSG') Then Do
  60.         Address Command 'Run <nil: >nil:' SCMSGPATH 'HIDDEN'
  61.         Address Command 'WaitForPort SC_SCMSG'
  62.     End
  63.  
  64.     If ~Show('ports', 'SC_SCMSG') Then Do
  65.         Call AddLib("rexxreqtools.library", 0, -30, 0)
  66.         If Show("Libraries","rexxreqtools.library") Then Do
  67.             rtEZRequest("Couldn't start ScMsg, giving up.", "Buhu!")
  68.         End
  69.         Else Do
  70.             Say "Couldn't start ScMsg, giving up."
  71.         End
  72.         Exit
  73.     End
  74.  
  75.     If Open('File', TmpFile, 'R') Then Do
  76.         Address 'SC_SCMSG'
  77.         DelFile FileName
  78.  
  79.         Do Until Eof('File')
  80.             Line = ReadLn('File')
  81.             Parse Var Line File ':::' Line ':::' Col ':::' ErrNum ':::' Msg
  82.             NewMsg '"'||FileName||'"' '"'||FileName||'"' Line '0 "" 0' "Warning" ErrNum Msg
  83.         End
  84.         Show Activate
  85.         Call Close('File')
  86.         Address Command 'Delete <nil: >nil: ' TmpFile
  87.     End
  88. End
  89.